package com.anda.account.domain.service;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.anda.account.constant.LoginState;
import com.anda.account.domain.model.system.User;
import com.anda.account.infrastructure.persistence.UserDao;

@Service("userService")
public class UserServiceImpl implements UserService {
	
	@Autowired
	private UserDao userDao;
	
	public void setUserDao(UserDao userDao) {
		this.userDao = userDao;
	}

	public void save(User user) {
		this.userDao.saveOrUpdate(user);
	}

	public LoginState getUserLoginState(User user) {
		return userDao.getUserLoginState(user);
	}

	public User getLoginUser(User user) {
		return userDao.getLoginUser(user);
	}

}
